import request from '@/utils/request';
import { stringify } from 'qs';

// // 获取账号信息
// export async function getAccountInfoOp(params) {
//   return request(`/blade-user/detail/000000/${params.userId}`);
// }

// 获取账号余额
export async function getAccountBalanceOp(params) {
  return request(`/blade-user/user/getBalance?${stringify(params)}`);
}

//获取提现详情
export async function getApplyDetails(params) {
  return request(`/blade-user/bankCard/withdrawDetailV2?${stringify(params)}`);
}

//登记行为记录信息
export async function registerBehaviorOp(params) {
  return request(`/zjf-pays/account/registerBehaviorRecordInfo`, {
    method: 'POST',
    data: params,
  });
}

//获取用户信息
export async function getLastLoginIp(params) {
  return request(`/zjf-oms/user/detail?${stringify(params)}`);
}

// //申请提现
export async function applyCashOp(params) {
  return request(`/blade-user/bankCard/withdraw`, {
    method: 'POST',
    data: params,
  });
}

//申请提现 支付宝/银行卡（常熟）
export async function applyCashAlipayOp(params) {
  return request(`/blade-user/bankCard/withdrawAlipay`, {
    method: 'POST',
    data: params,
  });
}

// 申请提现 (虚拟账号)
export async function virtualAccountApplyCashOp(params) {
  return request(`/blade-user/bankCard/withdrawVirtual`, {
    method: 'POST',
    data: params,
  });
}

//二类户申请提现发送验证码
export async function secondAccountSendsmsOp(params) {
  return request(`/blade-user/bankCard/balanceClassIIAccountCash?${stringify(params)}`);
}

// 二类户申请提现提交验证
export async function secondAccountApplyCashOp(params) {
  return request(`/blade-user/bankCard/balanceClassIIValidAccountCash`, {
    method: 'POST',
    data: params,
  });
}

//获取短信验证码
//mobile：传入手机号 type:短信类型:1为注册,2为登录,3重置登录密码,4重置支付密码,4绑定手机,5更改手机号绑定,6提现验证码,默认为9
// 增加appType
// 前台：2 后台：3
export async function getMoblieCaptchaOp(params) {
	try {
		if(params && (params.type == 2 || params.type == 3)) {
			params.appType = 2;
		}
	} catch(e) {
		console.log(e);
	}
  return request(`/blade-user/phone/getCode?${stringify(params)}`);
}
